import request from '@/utils/request';
import {AxiosPromise} from 'axios';
import {
  WorkPlanOperationLogForm,
  WorkPlanOperationLogQuery,
  WorkPlanOperationLogVO
} from '@/api/painting/workPlanOperationLog/types';

/**
 * 查询工作计划操作日志列表
 * @param query
 * @returns {*}
 */

export const listWorkPlanOperationLog = (query?: WorkPlanOperationLogQuery): AxiosPromise<WorkPlanOperationLogVO[]> => {
  return request({
    url: '/painting/workPlanOperationLog/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询工作计划操作日志详细
 * @param id
 */
export const getWorkPlanOperationLog = (id: string | number): AxiosPromise<WorkPlanOperationLogVO> => {
  return request({
    url: '/painting/workPlanOperationLog/' + id,
    method: 'get'
  });
};

/**
 * 新增工作计划操作日志
 * @param data
 */
export const addWorkPlanOperationLog = (data: WorkPlanOperationLogForm) => {
  return request({
    url: '/painting/workPlanOperationLog',
    method: 'post',
    data: data
  });
};

/**
 * 修改工作计划操作日志
 * @param data
 */
export const updateWorkPlanOperationLog = (data: WorkPlanOperationLogForm) => {
  return request({
    url: '/painting/workPlanOperationLog',
    method: 'put',
    data: data
  });
};

/**
 * 删除工作计划操作日志
 * @param id
 */
export const delWorkPlanOperationLog = (id: string | number | Array<string | number>) => {
  return request({
    url: '/painting/workPlanOperationLog/' + id,
    method: 'delete'
  });
};
